// GUITAR BATTLE!!


function guitarbattle()
{
	DetachCamera();
	SetPersonDirection(thePC.name, 'east');
	SetPersonX(thePC.name, 6*16+7);
	SetPersonY(thePC.name, 14*16+7);
	SetCameraX(8*16+7);
	
	charstats[thePC.name].speed *= 4;
	charstats[thePC.name].strength *= 4;
	charstats[thePC.name].hp *= 4;
	charstats[thePC.name].hp_max *= 4;
	if (party.length>1) party = [thePC.name];
	
	battleRT(createenemy(['Shredder',5,charstats[party[0]].hp_max*3,0,24,45,30,100,10,13,140,60,0,0,'3;'] ,0,0,true,false,true,'rockoutdude'),false, [thePC.name], ['guitar']);
	
	SetPersonScript('guitar', 3, "talkjunk('DUDE: You forgot that rock n roll never\\n dies!!');");

}



function guitarrockation()
{
	gang.pause4event = true;
	atbeq(";");
	atbeq("talkjunk('DUDE: Hold on!/w Before I die,/w/w let\\'s rock out!'); dontproceed=true;");
	atbeq("SetPersonScript(thePC.name, 4, 'walkgay(thePC, thePC.dirs[thePC.step]);');");
	atbeq("bproceed=false; thePC.dirs = ['fr','r','r','w','fd','w','bproceed=true;']; thePC.step=0; thePC.mark=0;");
	atbeq("rudess = new retard('rudess', 'OnionKid.rss', true); SetPersonX('rudess', 5*16+7); SetPersonY('rudess', 4*16+7); SetPersonDirection('rudess', 'masteronion');");
	atbeq("portno = new retard('portno', 'DrumDude.rss', true); SetPersonX('portno', 8*16+7); SetPersonY('portno',4*16+7); SetPersonDirection('portno', 'beatit'); SetPersonFrame('portno', 2);");
	atbeq("kybrd1 = GetTileImage(102); kybrd2 = GetTileImage(103); kybrd3 = GetTileImage(104); kybrd4 = GetTileImage(105); kybrdY=GetPersonY('rudess'); drmsY=GetPersonY('portno');");
	atbeq("fukkinmetalbgm = LoadSound('music/Kefkas_revenge.ogg');");
	atbeq("drms1=GetTileImage(96); drms2=GetTileImage(97); drms3=GetTileImage(98); drms4=GetTileImage(99); drms5=GetTileImage(100); drms6=GetTileImage(101);");
	atbeq("SetRenderScript('concertrender(); battal(); rendition();');");
	for (var k=0; k<48; k++)
	atbeq("kybrdY+=3;");
	atbeq("bproceed=false; SetDelayScript(15, 'bproceed=true;');");
	for (var k=0; k<38; k++)
	atbeq("drmsY+=3;");
	atbeq("bproceed=false; SetDelayScript(30, 'bproceed=true;');");
	atbeq("fukkinmetalbgm.play(false); fukkinmetalbgm.setPosition(6485000-17600*14);");
	atbeq("SetPersonScript('rudess', 4, 'if (rudess.step>rudess.dirs.length)rudess.step=0; walkgay(rudess, rudess.dirs[rudess.step]);');");
	atbeq("rudess.dirs = ['SetPersonFrame(\\'rudess\\', 0);', ';', ';', ';', ';', ';' ,';' ,'; ','SetPersonFrame(\\'rudess\\', 1);', ';', ';', ';', ';', ';', ';', ';', 'SetPersonFrame(\\'rudess\\', 2);',';',';',';',';',';',';',';','SetPersonFrame(\\'rudess\\', 3);', ';', ';', ';' , ';', ';', ';', ';', 'SetPersonFrame(\\'rudess\\', 4);' ,';', ';', ';', ';', ';', ';', ';', 'SetPersonFrame(\\'rudess\\', 5);' ,';', ';', ';', ';', ';', ';', ';'];");
	atbeq("SetPersonScript('portno', 4, 'if (portno.step > portno.dirs.length) portno.step=0; walkgay(portno, portno.dirs[portno.step]);');");
	atbeq("portno.dirs = ['SetPersonFrame(\\'portno\\', 0);',';',';',';',';',';',';',';','SetPersonFrame(\\'portno\\', 1);',';',';',';',';',';',';',';','SetPersonFrame(\\'portno\\', 2);',';',';',';',';',';',';',';','SetPersonFrame(\\'portno\\', 3);',';',';',';',';',';',';',';','SetPersonFrame(\\'portno\\', 4);',';',';',';',';',';',';',';','SetPersonFrame(\\'portno\\', 5);',';',';',';',';',';',';',';','SetPersonFrame(\\'portno\\', 6);',';',';',';',';',';',';',';'];");
	atbeq("SetPersonScript(thePC.name, 4, 'if (thePC.step > thePC.dirs.length) thePC.step=0; walkgay(thePC, thePC.dirs[thePC.step]);');");
	atbeq("thePC.dirs = ['SetPersonDirection(thePC.name, \\'blink\\');',';',';',';',';','SetPersonDirection(thePC.name, \\'lookup\\');',';',';',';',';','SetPersonDirection(thePC.name, \\'looksouth\\');',';',';',';',';'];");
	atbeq("bproceed = false; SetDelayScript(500, 'bproceed=true;');");
	atbeq("SetPersonScript(thePC.name, 4, 'walkgay(thePC, thePC.dirs[thePC.step]);');");
	atbeq("bproceed=false; thePC.dirs = ['fd','w','w','w','fl','l','fr','w','gang.dudeXs[0]=GetPersonX(thePC.name);', 'bproceed=true;']; thePC.step=0; thePC.mark=0;");
	

	bproceed = true;

	battleventrigs['rockoutdude'].happened[0] = true;	//should be queued
}


function concertrender()
{
	//keyboard
	SetPersonY('rudess', kybrdY+14);
	kybrd1.blit(map2screenX(74), map2screenY(kybrdY));		kybrd2.blit(map2screenX(74+16), map2screenY(kybrdY));
	kybrd3.blit(map2screenX(74), map2screenY(kybrdY+16));	kybrd4.blit(map2screenX(74+16), map2screenY(kybrdY+16));
	//drums
	SetPersonY('portno', drmsY+10);
	drms1.blit(map2screenX(112), map2screenY(drmsY));	drms2.blit(map2screenX(112+16), map2screenY(drmsY));	drms3.blit(map2screenX(112+32), map2screenY(drmsY));
	drms4.blit(map2screenX(112), map2screenY(drmsY+16));	drms5.blit(map2screenX(112+16), map2screenY(drmsY+16));	drms6.blit(map2screenX(112+32), map2screenY(drmsY+16));
	if (fukkinmetalbgm.getPosition() > 7790848-44000*11.5) fukkinmetalbgm.setPosition(6485000-17600*14);//6514278-17600*14);
}

function anotherjammer(nerd)
{
	gang.pause4event = true;
	atbeq(";");
	atbeq("talkjunk('DUDE: Ahh! I\\'m losing strength, I need more rocking out!');");
	atbeq("SetPersonScript(thePC.name, 4, 'walkgay(thePC, thePC.dirs[thePC.step]);');");
	atbeq("bproceed=false; thePC.dirs = ['fr','r','r','w','fd','bproceed=true;']; thePC.step=0;");
	atbeq("SetPersonScript(thePC.name, 4, 'if (thePC.step > thePC.dirs.length) thePC.step=0; walkgay(thePC, thePC.dirs[thePC.step]);');");
	atbeq("thePC.dirs = ['SetPersonDirection(thePC.name, \\'blink\\');',';',';',';','SetPersonDirection(thePC.name, \\'lookup\\');',';',';',';','SetPersonDirection(thePC.name, \\'looksouth\\');',';',';',';'];");
	atbeq("banger = new retard('banger', 'MariaMetal.rss', true); SetPersonX('banger', 19*16+7); SetPersonY('banger', 13.5*16+7); SetPersonLayer('banger', 1);");
	atbeq("SetPersonScript('banger', 4, 'walkgay(banger, banger.dirs[banger.step]);'); SetPersonSpeedXY('banger', 1.5,2);");
	atbeq("bproceed=false; banger.dirs=['fl','l','l','l','l','bproceed=true;']; banger.step=0;");
	atbeq("SetPersonScript('banger', 4, ';');");
	atbeq("banger.dirs = ['SetPersonDirection(\\'banger\\', \\'hbwest\\');'];");
	atbeq("for (var g=0; g<6; g++) banger.dirs = banger.dirs.concat(['SetPersonFrame(\\'banger\\', 0);', ';', ';', ';', ';', ';', 'SetPersonFrame(\\'banger\\', 1);',  ';', ';', ';', ';', ';']);");
	atbeq("banger.dirs = banger.dirs.concat(['SetPersonDirection(\\'banger\\', \\'hbeast\\');']);");
	atbeq("for (var g=0; g<6; g++) banger.dirs = banger.dirs.concat(['SetPersonFrame(\\'banger\\', 0);', ';', ';', ';', ';', ';', 'SetPersonFrame(\\'banger\\', 1);',  ';', ';', ';', ';', ';']);");
	atbeq("SetPersonScript('banger', 4, 'if (banger.step > banger.dirs.length) banger.step=0; walkgay(banger, banger.dirs[banger.step]);'); banger.step=0;");
	atbeq("bproceed=false; SetDelayScript(500, 'bproceed=true;');");
	atbeq("SetPersonScript(thePC.name, 4, 'walkgay(thePC, thePC.dirs[thePC.step]);');");
	atbeq("bproceed=false; thePC.dirs = ['fd','w','w','w','fl','l','fr','w', 'bproceed=true;']; thePC.step=0; thePC.mark=0;");
	atbeq("battleventrigs['rockoutdude'].happened[1] = true;");
	bproceed=true;
}



